#include "dominion.h"
#include "dominion_helpers.h"
#include "rngs.h"
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <stdbool.h>

#define MAX_CARD (treasure_map+1)
#define MAX_COST 9
void testGetCost (void)
{
    int totalCost = 0;
    int expectedCost = 105;
    for (int i = 0; i < MAX_CARD; i++)
    {
        int curCost = getCost (i);
        
        if (curCost < 0 || curCost >= MAX_COST)
        {
            printf ("%s: FAIL getting cost for card %d (%d is not a valid value!)\n", __func__, i, curCost);
            return;
        }
        
        totalCost += curCost;
    }
    
    if (totalCost != expectedCost)
        printf ("%s: FAIL summing costs for all cards (%d != %d!)\n", __func__, totalCost, expectedCost);
    else
        printf ("%s: PASS summing costs for all cards (got expected value %d.)\n", __func__, expectedCost);
}

int main (int argc, char *argv[])
{
    testGetCost ();
}
